import { init } from 'snabbdom/build/package/init';
import { h } from 'snabbdom/build/package/h';

const patch = init([])

let vnode = h('div#view1', [
  h('h1', 'hello world'),
  h('p', 'this is p')
])

let app = document.querySelector('#app')
let oldVnode = patch(app, vnode)

setTimeout(() => {
  vnode = h('div#COMTAINER', [
    h('h1', 'hello snabbdom'),
    h('p', 'this is p')
  ])
  // patch(oldVnode, vnode);
  patch(oldVnode, h('!'));// 清空
}, 2000)


